<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <meta charset="UTF-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <!--<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />-->
    <title>花开安装教程</title>
    <script data-res="HKtrust" src="/static/js/app/workspace/flexible.js"></script>
    <script data-res="HKtrust" src="/static/js/app/workspace/jquery.min.js"></script>
    <style>
        iframe:not(.huakai_iframe) {display:none !important;}
        *{margin: 0;padding: 0;background: #FFEDD9}
        div{width: 10rem;height: auto;position: relative}
        div>img{width: 100%;height: auto}
        div>a{
            position: fixed;
            width:6rem;
            height:1rem;
            line-height: 1rem;
            background: #f05c5c;
            color: #fff;
            font-size: 0.5rem;
            border-radius: 0.5rem;
            bottom: 0.5rem;
            left: 50%;
            margin-left: -3rem;
            text-align: center;
            text-decoration: none;
            z-index: 99;
        }
        .video{
            width: 10rem;
            height: auto;
            margin: 0 auto;
        }
        .video video{width: 100%;height: 8rem;margin-top: 1rem;}
        .video img{ width:100%; height:90%;}
        .video>p{
            text-align: center;
            color: #666;
            font-size: 0.4rem;
        }
    </style>

    <!--新增区分海内外ip-->
    <script data-res="HKtrust" src="https://pv.sohu.com/cityjson?ie=utf-8"></script>
    <script data-res="HKtrust">
        var genUrl = function (uri) {
            var domain = document.domain;
            if(domain.indexOf("local")>-1){
                domain=domain+":8080";
            }else{
                domain=domain;
            }
            var apiMode = "/api";
            if(document.domain.indexOf("local")>-1 || document.domain.indexOf("test")>-1){
                apiMode = "/api3";
            }
            return document.location.protocol + "//"  + domain + apiMode + uri;
            // return  "http//"  + domain + apiMode + uri;
        }
        var ip=returnCitySN['cip'];
        $.ajax({
            url:genUrl("/h5/download/checkIpAddress"),
            type: 'GET',
            contentType:"application/json",
            dataType:'json',
            async:false,
            data:{
                "ip":ip
            },
            success: function (res) {
                if(res.code=="0"){
                    var ipType=res.data.ipType;
                    if(ipType=="1"){//国内ip
                       // window.location.href="https://itunes.apple.com/cn/app/id1277470059"
                    }else{//海外ip
                        window.location.href="https://itunes.apple.com/cn/app/id1277470059"
                    }
                }
            }
        })

    </script>
</head>
<script data-res="HKtrust">
    var domain = document.domain;
    console.log(domain)
    if(domain.indexOf("local")>-1 || domain.indexOf("test")>-1 ){
        console.log("我是本地")
    }else{
        $("head").append('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests" />');
    }
</script>
<body>
<script data-res="HKtrust" src="/static/js/common/Monitor.js"></script>
<div data-res="HKtrust" class="video">
    <img src="/static/img/app/workspace/guide/one.jpg" alt="">
    <video poster="/static/img/app/workspace/guide/gutt.png" src="http://huakai-static.oss-cn-shenzhen.aliyuncs.com/video-help/%E8%8B%B9%E6%9E%9C%E5%AE%89%E8%A3%85%E6%96%B9%E6%B3%95.mp4" width="320" height="240" controls="controls">
    </video>
    <p>点击可以播放哦</p>
    <p style="color: #101010;margin-bottom:3rem;margin-top: 1rem">---以下内容为图文教程---</p>
    <div style="background: #FEEDD9">
        <img src="/static/img/app/workspace/guide/two.jpg" alt="">
        <!--<a href="itms-services:///?action=download-manifest&url=https://hkiosipa.oss-cn-shenzhen.aliyuncs.com/mianfest.plist">点击下载花开</a>-->
        <a id="onload">点击下载花开</a>
    </div>
</div>

<script data-res="HKtrust" type="text/javascript" src="//www.shareinstall.net/js/page/shareinstall-h5.min.js"></script>
    <!--<script data-res="HKtrust" src="shareinstall-h5.min.js"></script>-->
<script data-res="HKtrust" type="text/javascript">
        // var protocol=window.location.protocol;
        // if(protocol.indexOf("https")>-1){
        //     var url=window.location.href;
        //     window.location.href=url.replace(/https/g, "http")
        // }

        //shareinstall初始化，初始化时将与shareinstall服务器交互，应尽可能早的调用
        /*web页面向app传递的json数据(json string/js Object)，应用被拉起或是首次安装时，通过相应的
         android/ios api可以获取此数据*/
        var data = ShareInstall.parseUrlParams();//shareinstall.js中提供的工具函数，解析url中的所有查询参数
        var button = document.getElementById("onload");
        var domain = document.domain;
        data.appkey="BABK7E6KAKBEFH";
        new ShareInstall({
            appKey : 'BABK7E6KAKBEFH',
            onready : function() {
                // var m = this;
                button.style.visibility = "visible";
                /*在app已安装的情况尝试拉起app*/
                // m.schemeWakeup();
                /*用户点击某个按钮时(假定按钮id为downloadButton)，安装app*/
                button.onclick = function() {
                    // 测试环境
                    if(domain.indexOf('test') > -1) {
                       button.setAttribute("href","https://fir.im/huakaiios")
                       // button.setAttribute("href","itms-services:///?action=download-manifest&url=https://hkiosipa.oss-cn-shenzhen.aliyuncs.com/mianfest.plist")
                    } else {
                        button.setAttribute("href","itms-services:///?action=download-manifest&url=https://hkiosipa.oss-cn-shenzhen.aliyuncs.com/mianfest.plist")
                    }
                    // m.wakeupOrInstall();
                    // return false;
                }
            }
        }, data);
    </script>

<script data-res="HKtrust" src="/static/js/app/clearAdv.js"></script>
</body>
</html>